import 'package:flutter/material.dart';
import 'package:hook_up_rent/routes/index.dart';
import 'package:hook_up_rent/widgets/room_list_item.dart';
import 'package:hook_up_rent/widgets/search_bar/search_bar.dart';
import './widgets/data.dart';

class SearchPage extends StatefulWidget {
  const SearchPage({Key key}) : super(key: key);

  @override
  _SearchPageState createState() => _SearchPageState();
}

class _SearchPageState extends State<SearchPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: SearchBar(
            showLocation: true,
            showMap: true,
            onSearch: () {
              Navigator.of(context).pushNamed(MyRoutes.search);
            },
          ),
          centerTitle: true,
          backgroundColor: Colors.white,
        ),
        body: Column(
          children: [
            Container(height: 100.0, child: Text("filtter")),
            Expanded(
                child: Container(
              padding: EdgeInsets.all(10),
              child: ListView(
                children: dataList.map((e) => RoomListItem(e)).toList(),
              ),
            ))
          ],
        ));
  }
}
